home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.5 / Include / include_i / intuition / gadgetclass.i < prev    next >
Encoding:
Text File  |  1999-10-30  |  10.7 KB  |  364 lines

  1.     IFND INTUITION_GADGETCLASS_I
  2. INTUITION_GADGETCLASS_I SET 1
  3. **
  4. ** $VER: gadgetclass.i 44.1 (19.10.1999)
  5. ** Includes Release 44.1
  6. **
  7. ** Custom and 'boopsi' gadget class interface
  8. **
  9. **  (C) Copyright 1989-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.     IFND EXEC_TYPES_I
  14.     INCLUDE "exec/types.i"
  15.     ENDC
  16.  
  17.     IFND INTUITION_INTUITION_I
  18.     INCLUDE "intuition/intuition.i"
  19.     ENDC
  20.  
  21.     IFND UTILITY_TAGITEM_I
  22.     INCLUDE "utility/tagitem.i"
  23.     ENDC
  24.  
  25.  
  26. *
  27. * NOTE:  intuition/iobsolete.i is included at the END of this file!
  28. *
  29.  
  30. ; Gadget Class attributes
  31.  
  32. GA_Dummy        EQU    (TAG_USER+$30000)
  33. GA_Left            EQU    (GA_Dummy+$0001)
  34. GA_RelRight        EQU    (GA_Dummy+$0002)
  35. GA_Top            EQU    (GA_Dummy+$0003)
  36. GA_RelBottom        EQU    (GA_Dummy+$0004)
  37. GA_Width        EQU    (GA_Dummy+$0005)
  38. GA_RelWidth        EQU    (GA_Dummy+$0006)
  39. GA_Height        EQU    (GA_Dummy+$0007)
  40. GA_RelHeight        EQU    (GA_Dummy+$0008)
  41. GA_Text            EQU    (GA_Dummy+$0009)  ; ti_Data is (UBYTE *)
  42. GA_Image        EQU    (GA_Dummy+$000A)
  43. GA_Border        EQU    (GA_Dummy+$000B)
  44. GA_SelectRender        EQU    (GA_Dummy+$000C)
  45. GA_Highlight        EQU    (GA_Dummy+$000D)
  46. GA_Disabled        EQU    (GA_Dummy+$000E)
  47. GA_GZZGadget        EQU    (GA_Dummy+$000F)
  48. GA_ID            EQU    (GA_Dummy+$0010)
  49. GA_UserData        EQU    (GA_Dummy+$0011)
  50. GA_SpecialInfo        EQU    (GA_Dummy+$0012)
  51. GA_Selected        EQU    (GA_Dummy+$0013)
  52. GA_EndGadget        EQU    (GA_Dummy+$0014)
  53. GA_Immediate        EQU    (GA_Dummy+$0015)
  54. GA_RelVerify        EQU    (GA_Dummy+$0016)
  55. GA_FollowMouse        EQU    (GA_Dummy+$0017)
  56. GA_RightBorder        EQU    (GA_Dummy+$0018)
  57. GA_LeftBorder        EQU    (GA_Dummy+$0019)
  58. GA_TopBorder        EQU    (GA_Dummy+$001A)
  59. GA_BottomBorder        EQU    (GA_Dummy+$001B)
  60. GA_ToggleSelect        EQU    (GA_Dummy+$001C)
  61.  
  62. * internal use only, until further notice, please
  63. GA_SysGadget        EQU    (GA_Dummy+$001D)
  64. * bool, sets GTYP_SYSGADGET field in type
  65. GA_SysGType        EQU    (GA_Dummy+$001E)
  66. * e.g., GTYP_WUPFRONT, ...
  67.  
  68. GA_Previous        EQU    (GA_Dummy+$001F)
  69. * previous gadget (or (struct Gadget **)) in linked list
  70. * NOTE: This attribute CANNOT be used to link new gadgets
  71. * into the gadget list of an open window or requester.
  72. * You must use AddGList().
  73.  
  74. GA_Next            EQU    (GA_Dummy+$0020)
  75. * not implemented
  76.  
  77. GA_DrawInfo        EQU    (GA_Dummy+$0021)
  78. * some fancy gadgets need to see a DrawInfo
  79. * when created or for layout
  80.  
  81. * You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage
  82. GA_IntuiText        EQU    (GA_Dummy+$0022)
  83. * ti_Data is (struct IntuiText    *)
  84.  
  85. GA_LabelImage        EQU    (GA_Dummy+$0023)
  86. * ti_Data is an image (object), used in place of
  87. * GadgetText
  88.  
  89. GA_TabCycle        EQU    (GA_Dummy+$0024)
  90. * New for V37:
  91. * Boolean indicates that this gadget is to participate in
  92. * cycling activation with Tab or Shift-Tab.
  93.  
  94. GA_GadgetHelp        EQU    (GA_Dummy+$0025)
  95. * New for V39:
  96. * Boolean indicates that this gadget sends gadget-help
  97.  
  98. GA_Bounds        EQU    (GA_Dummy+$0026)
  99. * New for V39:
  100. * ti_Data is a pointer to an IBox structure which is
  101. * to be copied into the extended gadget's bounds.
  102.  
  103. GA_RelSpecial        EQU    (GA_Dummy+$0027)
  104. * New for V39:
  105. * Boolean indicates that this gadget has the "special relativity"
  106. * property, which is useful for certain fancy relativity
  107. * operations through the GM_LAYOUT method.
  108.  
  109. GA_TextAttr        EQU    (GA_Dummy+40)
  110. GA_ReadOnly        EQU    (GA_Dummy+41)
  111. GA_Underscore        EQU    (GA_Dummy+42)
  112. GA_ActivateKey        EQU    (GA_Dummy+43)
  113. GA_BackFill        EQU    (GA_Dummy+44)
  114. GA_GadgetHelpText    EQU    (GA_Dummy+45)
  115. GA_UserInput        EQU    (GA_Dummy+46)
  116.  
  117. * PROPGCLASS attributes
  118.  
  119. PGA_Dummy        EQU    (TAG_USER+$31000)
  120. PGA_Freedom        EQU    (PGA_Dummy+$0001)
  121. * either or both of FREEVERT and FREEHORIZ
  122. PGA_Borderless        EQU    (PGA_Dummy+$0002)
  123. PGA_HorizPot        EQU    (PGA_Dummy+$0003)
  124. PGA_HorizBody        EQU    (PGA_Dummy+$0004)
  125. PGA_VertPot        EQU    (PGA_Dummy+$0005)
  126. PGA_VertBody        EQU    (PGA_Dummy+$0006)
  127. PGA_Total        EQU    (PGA_Dummy+$0007)
  128. PGA_Visible        EQU    (PGA_Dummy+$0008)
  129. PGA_Top            EQU    (PGA_Dummy+$0009)
  130. ; New for V37:
  131. PGA_NewLook        EQU    (PGA_Dummy+$000A)
  132.  
  133. * STRGCLASS attributes
  134.  
  135. STRINGA_Dummy          EQU    (TAG_USER+$32000)
  136. STRINGA_MaxChars    EQU    (STRINGA_Dummy+$0001)
  137. * Note:  There is a minor problem with Intuition when using boopsi integer
  138. * gadgets (which are requested by using STRINGA_LongInt).  Such gadgets
  139. * must not have a STRINGA_MaxChars to be bigger than 15.  Setting
  140. * STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched
  141. * FreeMem() to occur.
  142.  
  143. STRINGA_Buffer        EQU    (STRINGA_Dummy+$0002)
  144. STRINGA_UndoBuffer    EQU    (STRINGA_Dummy+$0003)
  145. STRINGA_WorkBuffer    EQU    (STRINGA_Dummy+$0004)
  146. STRINGA_BufferPos    EQU    (STRINGA_Dummy+$0005)
  147. STRINGA_DispPos        EQU    (STRINGA_Dummy+$0006)
  148. STRINGA_AltKeyMap    EQU    (STRINGA_Dummy+$0007)
  149. STRINGA_Font        EQU    (STRINGA_Dummy+$0008)
  150. STRINGA_Pens        EQU    (STRINGA_Dummy+$0009)
  151. STRINGA_ActivePens    EQU    (STRINGA_Dummy+$000A)
  152. STRINGA_EditHook    EQU    (STRINGA_Dummy+$000B)
  153. STRINGA_EditModes    EQU    (STRINGA_Dummy+$000C)
  154.  
  155. * booleans
  156. STRINGA_ReplaceMode    EQU    (STRINGA_Dummy+$000D)
  157. STRINGA_FixedFieldMode    EQU    (STRINGA_Dummy+$000E)
  158. STRINGA_NoFilterMode    EQU    (STRINGA_Dummy+$000F)
  159.  
  160. STRINGA_Justification    EQU    (STRINGA_Dummy+$0010)
  161. * GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT
  162. STRINGA_LongVal        EQU    (STRINGA_Dummy+$0011)
  163. STRINGA_TextVal        EQU    (STRINGA_Dummy+$0012)
  164.  
  165. STRINGA_ExitHelp    EQU    (STRINGA_Dummy+$0013)
  166. * STRINGA_ExitHelp is new for V37, and ignored by V36.
  167. * Set this if you want the gadget to exit when Help is
  168. * pressed.  Look for a code of 0x5F, the rawkey code for Help
  169.  
  170. SG_DEFAULTMAXCHARS    EQU    (128)
  171.  
  172. * Gadget Layout related attributes
  173.  
  174. LAYOUTA_Dummy         EQU    (TAG_USER+$38000)
  175. LAYOUTA_LayoutObj    EQU    (LAYOUTA_Dummy+$0001)
  176. LAYOUTA_Spacing        EQU    (LAYOUTA_Dummy+$0002)
  177. LAYOUTA_Orientation    EQU    (LAYOUTA_Dummy+$0003)
  178. LAYOUTA_ChildMaxWidth    EQU    (LAYOUTA_Dummy+$0004)
  179. LAYOUTA_ChildMaxHeight    EQU    (LAYOUTA_Dummy+$0005)
  180.  
  181. * orientation values
  182. LORIENT_NONE        EQU    0
  183. LORIENT_HORIZ        EQU    1
  184. LORIENT_VERT        EQU    2
  185.  
  186. ; Custom gadget hook command ID's
  187. ; (gadget class method/message ID's)
  188.  
  189. GM_HITTEST EQU        0    ; return GMR_GADGETHIT if you are clicked
  190.                 ; (whether or not you are disabled)
  191. GM_RENDER EQU        1    ; draw yourself, in the appropriate state
  192. GM_GOACTIVE EQU        2    ; you are now going to be fed input
  193. GM_HANDLEINPUT EQU    3    ; handle that input
  194. GM_GOINACTIVE EQU    4    ; whether or not by choice, you are done
  195. GM_HELPTEST EQU        5    ; Will you send gadget help if the mouse is
  196.                 ; at the specified coordinates?  See below
  197.                 ; for possible GMR_ values.
  198. GM_LAYOUT EQU        6    ; re-evaluate your size based on the GadgetInfo
  199.                 ; Domain.  Do NOT re-render yourself yet, you
  200.                 ; will be called when it is time...
  201. GM_DOMAIN EQU        7
  202. GM_KEYTEST EQU        8
  203. GM_KEYGOACTIVE EQU    9
  204. GM_KEYGOINACTIVE EQU    10
  205.  
  206. ; Parameter "Messages" passed to gadget class methods
  207.  
  208. ; All parameter structure begin with a MethodID field
  209. ; This definition of an abstract generic "message" is
  210. ; equivalent to a better one in intuition/classusr.i, but
  211. ; it's left here for historic reasons
  212.  STRUCTURE MsgHeader,0
  213.     ULONG    MethodID
  214.     LABEL    methodid_SIZEOF
  215.  
  216. ; GM_HITTEST and GM_HELPTEST send this message.
  217. ; For GM_HITTEST, gpht_Mouse are coordinates relative to the gadget
  218. ; select box.  For GM_HELPTEST, the coordinates are relative to
  219. ; the gadget bounding box (which defaults to the select box).
  220.  STRUCTURE    gpHitTest,methodid_SIZEOF
  221.     APTR    gpht_GInfo
  222.     WORD    gpht_MouseX
  223.     WORD    gpht_MouseY
  224.  
  225. ; For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  226. ; otherwise return zero.
  227. ;
  228. ; For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  229. ; Typically, return GMR_HELPHIT if you were hit.
  230. ; It is possible to pass a UWORD to the application via the Code field
  231. ; of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  232. ; the UWORD-sized result you wish to return.
  233. ;
  234. ; GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  235. ; mean "nothing particular" to the application.
  236.  
  237. GMR_GADGETHIT    EQU $00000004    ; GM_HITTEST hit
  238.  
  239. GMR_NOHELPHIT    EQU $00000000    ; GM_HELPTEST didn't hit
  240. GMR_HELPHIT    EQU $FFFFFFFF    ; GM_HELPTEST hit, return code = ~0
  241. GMR_HELPCODE    EQU $00010000    ; GM_HELPTEST hit, return low word as code
  242.  
  243. ; GM_RENDER
  244.  STRUCTURE    gpRender,methodid_SIZEOF
  245.     APTR    gpr_GInfo    ; gadget context
  246.     APTR    gpr_RPort    ; all ready for use
  247.     LONG    gpr_Redraw    ; might be a "highlight pass"
  248.  
  249. ; values of gpr_Redraw
  250. GREDRAW_UPDATE    EQU 2    ; update for change in attributesvalues
  251. GREDRAW_REDRAW    EQU 1    ; redraw gadget
  252. GREDRAW_TOGGLE    EQU 0    ; toggle highlight, if applicable
  253.  
  254. ; GM_GOACTIVE, GM_HANDLEINPUT
  255.  STRUCTURE    gpInput,methodid_SIZEOF
  256.     APTR    gpi_GInfo
  257.     APTR    gpi_IEvent
  258.     APTR    gpi_Termination
  259.     WORD    gpi_MouseX
  260.     WORD    gpi_MouseY
  261.  
  262.     ; (V39) Pointer to TabletData structure, if this event originated
  263.     ; from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  264.     ; not.
  265.     ;
  266.     ; DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  267.     ; IT WILL BE INVALID!
  268.     APTR    gpi_TabletData
  269.  
  270. ; GM_HANDLEINPUT and GM_GOACTIVE  return code flags
  271. ; return GMR_MEACTIVE (0) alone if you want more input.
  272. ; Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  273. ; GMR_VERIFY.
  274.  
  275. ; here are the original constant "equates"
  276. GMR_MEACTIVE    EQU $0000    ; (bugfix: was $0001 during beta)
  277. GMR_NOREUSE    EQU $0002
  278. GMR_REUSE    EQU $0004
  279. GMR_VERIFY    EQU $0008    ; you MUST set gpi_Termination
  280.  
  281. * New for V37:
  282. * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  283. * which instructs Intuition to activate the next or previous gadget
  284. * that has GFLG_TABCYCLE set.
  285. *
  286. GMR_NEXTACTIVE    EQU $0010
  287. GMR_PREVACTIVE    EQU $0020
  288.  
  289. ; here are standard bit/flag pairs
  290. GMRB_NOREUSE    EQU 1
  291. GMRB_REUSE    EQU 2
  292. GMRB_VERIFY    EQU 3
  293. GMRB_NEXTACTIVE    EQU 4
  294. GMRB_PREVACTIVE    EQU 5
  295.  
  296. GMRF_NOREUSE    EQU $0002
  297. GMRF_REUSE    EQU $0004
  298. GMRF_VERIFY    EQU $0008
  299. GMRF_NEXTACTIVE    EQU $0010
  300. GMRF_PREVACTIVE    EQU $0020
  301.  
  302. ; GM_GOINACTIVE
  303.  STRUCTURE    gpGoInactive,methodid_SIZEOF
  304.     APTR    gpgi_GInfo
  305.  
  306. * V37 field only!  DO NOT attempt to read under V36!
  307.     ULONG    gpgi_Abort    ; gpgi_Abort=1 if gadget was aborted
  308.                 ; by Intuition and 0 if gadget went
  309.                 ; inactive at its own request
  310.  
  311. * New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  312. * the window opens, or when the gadget is activated, or when the
  313. * window is sized.  Your gadget can set the GA_RelSpecial property
  314. * to get GM_LAYOUT events without Intuition changing the interpretation
  315. * of your gadget select box.
  316.  
  317. ; GM_LAYOUT
  318.  STRUCTURE    gpLayout,methodid_SIZEOF
  319.     APTR    gpl_GInfo
  320.     APTR    gpl_Initial    ; non-zero if this method was invoked
  321.                 ; during AddGList() or OpenWindow()
  322.                 ; time.  zero if this method was invoked
  323.                 ; during window resizing.
  324.  
  325. ; GM_DOMAIN
  326.  STRUCTURE    gpDomain,methodid_SIZEOF
  327.     APTR    gpd_GInfo
  328.     APTR    gpd_RPort
  329.     LONG    gpd_Which
  330.     STRUCT    gpd_Domain,ibox_SIZEOF
  331.     APTR    gpd_Attrs
  332.  
  333. GDOMAIN_MINIMUM        EQU    0
  334. GDOMAIN_NOMINAL        EQU    1
  335. GDOMAIN_MAXIMUM        EQU    2
  336.  
  337. ; GM_KEYTEST
  338.  STRUCTURE    gpKeyTest,methodid_SIZEOF
  339.     APTR    gpkt_GInfo
  340.     APTR    gpkt_IMsg
  341.     ULONG    gpkt_VanillaKey
  342.  
  343. ; GM_KEYGOACTIVE
  344.  STRUCTURE    gpKeyInput,methodid_SIZEOF
  345.     APTR    gpk_GInfo
  346.     APTR    gpk_IEvent
  347.     APTR    gpk_Termination
  348.  
  349. GMR_KEYACTIVE        EQU $0010
  350. GMR_KEYVERIFY        EQU $0020
  351.  
  352. ; GM_KEYGOINACTIVE
  353.  STRUCTURE    gpKeyGoInactive,methodid_SIZEOF
  354.      APTR    gpki_GInfo
  355.      ULONG    gpki_Abort
  356.  
  357.  
  358. * Include obsolete identifiers:
  359.     IFND    INTUITION_IOBSOLETE_I
  360.     INCLUDE "intuition/iobsolete.i"
  361.     ENDC
  362.  
  363.     ENDC
  364.